# Contributor: Matthias Ahouansou <matthias@ahouansou.cz>
# Maintainer: Matthias Ahouansou <matthias@ahouansou.cz>
pkgname=tree-sitter-markdown
pkgver=0.1.7
pkgrel=0
pkgdesc="A markdown grammar for tree-sitter"
url="https://github.com/Mdeiml/tree-sitter-markdown"
arch="all"
license="MIT"
makedepends="tree-sitter-dev"
subpackages="$pkgname-doc"
provides="tree-sitter-markdown-inline=$pkgver-r$pkgrel"
install_if="tree-sitter-grammars"
source="$pkgname-$pkgver.tar.gz::https://github.com/Mdeiml/tree-sitter-markdown/archive/refs/tags/v$pkgver.tar.gz"
options="!check" # no tests for shared lib

_langs='markdown markdown-inline'

build() {
	local lang; for lang in $_langs; do
		abuild-tree-sitter build -s "tree-sitter-$lang/src"
	done
}

package() {
	local lang; for lang in $_langs; do
		DESTDIR="$pkgdir" abuild-tree-sitter install -s "tree-sitter-$lang/src"
	done
	install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

sha512sums="
405c4eae994367cdc4e1813af7b45f344aed492708d3b11ca58cc7a65d488ad1bd83c62e14c0e0fcf20132116d065e55977a14292b738b256c2642f34469041f  tree-sitter-markdown-0.1.7.tar.gz
"
